{{include file="default/Public/header.html"}}
<script language="javascript" src="{{$smarty.const._PUBLIC_}}js/editable/jquery.editable.js"></script>
<script language="javascript">
$().ready(function (){	
	//排序
	$(".editable_sort").editable("{{U url='fcontent/edit?ajax=sort'}}",{
			indicator : '<img src="__ROOT__/admin/Public/images/loading2.gif" />',
      		tooltip   : "点击可快速编辑排序",
			name			: 'sort',
			id				: 'cid',
			placeholder : '不可用',
			submitdata : {"catid":'{{$cat.catid}}'},
			select	  : true,
			event	  : "click",
			width     : 20,
			onblur : "submit"
	});
	//标题
	$(".editable_title").editable("{{U url='fcontent/edit?ajax=savetitle'}}",{
			indicator : '<img src="__ROOT__/admin/Public/images/loading2.gif" />',
     		tooltip   : "点击可快速编辑标题",
			name			: 'title',
			id				: 'cid',
			placeholder : '不可用',
			submitdata : {"catid":'{{$cat.catid}}'},
			select	  : true,
			event	  : "click",
			onblur : "submit"
	});
	//更新时间
	$(".editable_updatetime").editable("{{U url='fcontent/edit?ajax=updatetime'}}",{
			indicator : '<img src="__ROOT__/admin/Public/images/loading2.gif" />',
      tooltip   : "点击可快速编辑时间",
			name			: 'updatetime',
			id				: 'cid',
			placeholder : '不可用',
			submitdata : {"catid":'{{$cat.catid}}'},
			select	  : true,
			event	  : "click",
			onblur : "submit"
	});
	//栏目
	$(".editable_category").editable("{{U url='fcontent/edit?ajax=category'}}",{
			indicator : '<img src="__ROOT__/admin/Public/images/loading2.gif" />',
      tooltip   : "点击可快速移动到同类型其他栏目",
			name			: 'new_catid',
			id				: 'cid',
			type			: 'select',
			placeholder : '不可用',
			data			: '{{$cat_json}}',
			submitdata : {"catid":'{{$cat.catid}}'},
			select	  : true,
			event	  : "click",
			onblur : "submit"
	});
	//标记为，表单提交
	$("#flagto").change(function (){
		var flagto_length = $("input[name='info[cid][]']:checked").length;
		if(flagto_length > 0 && $(this).val()!='flagto') {
			$('#action').val('edit');
			$('#do').val('status');
			$('#myform').submit();
		} else { //提示并还原下拉菜单
			if($(this).val() != 'flagto') {
				alert("未选择操作项！");
			}	
			$(this).val('flagto');
		}
	});
	//移动到，表单提交
	$("#moveto").change(function (){
		var moveto_length = $("input[name='info[cid][]']:checked").length;
		if(moveto_length > 0 && $(this).val()!='moveto') {
			if($(this).val() == '-1') {  //移动到回收站
					$('#action').val('edit');
					$('#do').val('recycle');
			} else {  //移动至其他栏目
					$('#action').val('edit');
					$('#do').val('moveto');
			}
			$('#myform').submit();
		} else { //提示并还原下拉菜单			
			if($(this).val() != 'moveto') {
				alert("未选择操作项！");
			}	
			$(this).val('moveto');
		}
	});
});
</script>
<form id="myform" name="myform" method="post" action='__APP__'  >
<div id="pageTop">
	<div class="addBtn"><a href='{{U url="fjiudianprice/add?cid=`$in.cid`"}}'>添加房型</a></div>
</div>
<div id="pageCo">
	<div class="listForm">
		<table cellpadding="0" cellspacing="0">
			<thead>
				<tr>
					<th width="50">ID</th>	
					<th width="80">酒店ID</th>					
					<th width="180">房型</th>										
					<th width="80">市场价</th>
					<th width="80">优惠价</th>
					<th width="100">早餐</th>
					<th width="100">宽带</th>
					<th width="150">床型</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			{{foreach from=$data item=v}}      
		      <tr>
		      	<td>{{$v.id}}</td>
		        <td>{{$v.cid}}</td>
		        <td>{{$v.fangxing}}</td>
		        <td>{{$v.shichang}}</td>
		        <td>{{$v.youhui}}</td>
		        <td>{{$v.zaocan}}</td>
		        <td>{{$v.kuandai}}</td>
		        <td>{{$v.chuangxing}}</td>
		        <td>
		         	<a href='{{U url="fjiudianprice/edit?cid=`$v.cid`&id=`$v.id`"}}' title="更新内容">编辑</a> | 
		        	<a href="{{U url="fjiudianprice/delete?cid=`$v.cid`&id=`$v.id`"}}" title="删除">删除</a>
		        </td>
		      </tr>
		      {{foreachelse}}
		      <tr><td colspan="9">暂无记录！</td></tr>
		      {{/foreach}}
			</tbody>
		</table>	
	</div>	
	<div class="pageList">
		{{$data.pages}}
		<ul class="clearit"></ul> 
	</div>
</div>
<input type="hidden" name="m" id="module" value="fcontent" />
<input type="hidden" name="a" id="action" value="manage" />
<input type="hidden" name="do" id="do" value="" />
<input type="hidden" name="newsid" value="{{$newsid}}" >
<input type="hidden" name="catid" id="catid" value="{{$cat.catid}}" />
</form>
{{include file="default/Public/footer.html"}}